package org.vestbjergbyggecenter.Test;

import static org.junit.Assert.*;

import org.junit.Test;
import org.vestbjergbyggecenter.Model.Category;
import org.vestbjergbyggecenter.Model.Product;

public class TestProduct {

	@Test
    public void testSetId()
    {
	 	Category category = new Category("title" , 10);
        Product product1 = new Product(1,"Ivo", category, 71388.0, 1, "Aalborg");
        product1.setId(1);
        assertEquals(1, product1.getId());
    }
 
 @Test
 public void testGetProductDiscountPrice()
 {
	 Category category = new Category("title" , 10);
     Product product1 = new Product(1,"Ivo", category, 100.0, 1, "Aalborg");
     
     double discountPrice=product1.getProductDiscountPrice();
        
     assertEquals(90, discountPrice, 0);        
 }
 
 @Test
 public void testDecreaseQuantity()
 {
	 Category category = new Category("title" , 10);
     Product product1 = new Product(1,"Ivo", category, 100.0, 2, "Aalborg");
     
     product1.decreaseQuantity(1);
     double productQuantity=product1.getQuantity();
     
     assertEquals(1, productQuantity, 0);
     
 }

}
